﻿//-----------------------------------------------------------------------------
//
//
//
//-----------------------------------------------------------------------------
// Exo² ffa01
// Copyright (C) 2007-2008 Samuel Lacroix and Raphaël Legouge
//
// Distributed under GNU General Public License
// See the License folder of Exo² for details
//
//
// http://www.codeplex.com/exo2 (eng)
//-----------------------------------------------------------------------------


#ifndef FFA01_H
#define FFA01_H
#pragma once


#include "gui.h"
#include "server.h"
#include "client.h"


class CFFA : public Exo2::CApplication
{
    public:
        CFFA();
        
        boost::scoped_ptr<GUI::CMenuDataManager> pMenuDataManager;
         
    private:
    // Console
        // Server
        bool ServerCreateCmd(const std::vector<tstring>& Instructions);
        bool ServerDestroyCmd(const std::vector<tstring>& Instructions);
        bool ServerKickCmd(const std::vector<tstring>& Instructions);
        bool ServerBanCmd(const std::vector<tstring>& Instructions);
        bool ServerUnbanCmd(const std::vector<tstring>& Instructions);
        bool ServerGetBannedCmd(const std::vector<tstring>& Instructions);
        bool ServerGetPeersInfoCmd(const std::vector<tstring>& Instructions);
        bool ServerTickRateCmd(const std::vector<tstring>& Instructions);
        bool ServerWelcomMessageCmd(const std::vector<tstring>& Instructions);
        bool ServerVerbosityCmd(const std::vector<tstring>& Instructions);
        bool ServerGetPlayersInfoCmd(const std::vector<tstring>& Instructions);
        bool ServerSayCmd(const std::vector<tstring>& Instructions);
        
        // Client
        bool ClientCreateCmd(const std::vector<tstring>& Instructions);
        bool ClientDestroyCmd(const std::vector<tstring>& Instructions);
        bool ClientTickRateCmd(const std::vector<tstring>& Instructions);        
        bool ClientVerbosityCmd(const std::vector<tstring>& Instructions);
        bool ClientJoinCmd(const std::vector<tstring>& Instructions);
        bool ClientQuitCmd(const std::vector<tstring>& Instructions);
        bool ClientNameCmd(const std::vector<tstring>& Instructions);
        bool ClientUpdateRateCmd(const std::vector<tstring>& Instructions);
        bool ClientInterpolationCmd(const std::vector<tstring>& Instructions);
        bool ClientNetgraphCmd(const std::vector<tstring>& Instructions);
        bool ClientSayCmd(const std::vector<tstring>& Instructions);
        bool ClientLatenciesCmd(const std::vector<tstring>& Instructions);
        bool ClientLossCmd(const std::vector<tstring>& Instructions);
        bool ClientGetPlayersInfoCmd(const std::vector<tstring>& Instructions);
    
    // Menu
        boost::scoped_ptr<GUI::COnResolutionChange> pMenuDynamicResize;
        
    // Réseau
        scoped_ptr<Exo2::CNetService> pNetService;
        
        // Server
        scoped_ptr<CServer> pServer;
        
        // Client
        scoped_ptr<CClient> pClient;

    // Surcharge de la class application
        IDirect3DDevice9* pDev;
        void RegisterConfigProperties();
        void RegisterGameActions();
        void DeviceCreated();
        void DeviceDestroyed();
        void DeviceReset(); 
        void DeviceLost();
        void OnCreated();
        void OnDestroying();
        void Update(double TotalTime, float ElapsedTime);
        void Render3D() const;
        void Render2D() const;
        LPCTSTR GetAppGUID() const { return _T("{24284C02-C201-40cd-A3C8-5E0ABE993C61}"); }     // GUID Généré le mardi 18 mars 2008 20:52:42  
        
    // Mise à jour du menu
        void UpdateMenu(double TotalTime, float ElapsedTime);
};
 

#endif